<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript">
<!--
	$(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
	$("#currencylist").formValidator({onshow:"请选择货币类型",onfocus:"请选择货币类型",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请选择货币类型"});
	$("#fullname").formValidator({onshow:"请输入货币名称",onfocus:"请输入货币名称"}).inputValidator({min:1,onerror:"请输入货币名称"});
 	$("#exchange").formValidator({onshow:"请输入汇率",onfocus:"请输入汇率"}).inputValidator({min:1,onerror:"请输入汇率"}).regexValidator({regexp:"[1-9]\\d*(.\\d{5})?$",onerror:"汇率只能为小数"})
	 
	})
//-->
</script>

<div class="pad_10">
<form action="__SELF__" method="post" name="myform" id="myform">
<table cellpadding="2" cellspacing="1" class="table_form" width="100%">
	<tr>
		<th width="100">货币代码：</th>
		<td><select id="currencylist" name="name" class="select" title="<?php echo $currency['name']?>" disabled><option value="">货币类型</option></select></td>
	</tr>
	<tr>
		<th width="100">货币名称：</th>
		<td><input type="text" name="fullname" id="fullname" value="<?php echo $currency['fullname']?>"	size="30" class="input-text"></td>
	</tr>
	<tr>
		<th width="100">货币符号：</th>
		<td><input type="text" name="symbol" id="symbol" size="30" value="<?php echo $currency['symbol']?>" class="input-text"></td>
	</tr>
	<tr>
		<th>显示位置：</th>
		<td><input name="isleft" type="radio" value="1" <?php if($currency['isleft']==1) echo'checked';?>>&nbsp;左边&nbsp;&nbsp;
		<input name="isleft" type="radio" value="0" <?php if($currency['isleft']==0) echo'checked';?>>&nbsp;右边 <div class="infoShow">货币符号显示位置</div></td>
	</tr>
	<tr>
		<th width="100">汇率：</th>
		<td><input type="text" name="exchange" id="exchange" value="<?php echo $currency['exchange']?>" size="30" class="input-text"></td>
	</tr>
	<tr>
		<th>默认货币：</th>
		<td><input name="default" type="radio" value="1" <?php if($currency['default']==1) echo'checked';?>>&nbsp;是&nbsp;&nbsp;<input name="default" type="radio" value="0" <?php if($currency['default']==0) echo'checked';?>>&nbsp;否</td>
	</tr>
	<tr>
		<th>显示：</th>
		<td><input name="visible" type="radio" value="1" <?php if($currency['visible']==1) echo'checked';?>>&nbsp;是&nbsp;&nbsp;<input 	name="visible" type="radio" value="0" <?php if($currency['visible']==0) echo'checked';?>>&nbsp;否</td>
	</tr>
	<tr>
    <th>关联语言：</th>
    <td class="y-bg">
    <?php if(isset($languageList) && $languageList):?>
		<select name="language_id">
			<?php 
			foreach ($languageList as $language_id => $language_name):
				if(!is_numeric($language_id)) continue;
			?>
			<option value="<?php echo $language_id;?>" <?php if(isset($currency['language_id'])&& $currency['language_id']==$language_id) echo 'selected';?>><?php echo $language_name;?></option>
			<?php endforeach;?>
		</select>
		<?php else:?>
		<input name="language_id" value="1" type="hidden" />
		<?php if(C('DEFAULT_LANG')=='en-us')echo '英文';else echo '中文';?>
		<?php endif;?>
    </td>
  </tr>
</table>
<div class="bk15"></div>
    <input name="dosubmit" type="submit" class="dialog" value="提交" id="dosubmit" />
</form>
</div>
</body>
<script type="text/javascript">
$(function(){
	getcurrencylist();
});
function getcurrencylist(){
    var select = document.getElementById('currencylist');
    var currencyArray = ["人民币|CNY|人民币元","美元|USD|美元","奥币|ATS|奥地利先令","澳元|AUD|澳元","比法郎|BEF|比利时法郎","巴西币|BRL|巴西里尔","加元|CAD|加元","瑞郎|CHF|瑞郎","智利币|CLP|智利比索","捷克币|CZK|捷克克朗","马克|DEM|德国马克","丹麦币|DKK|丹麦克朗","西币|ESP|西班牙比塞塔","欧元|EUR|欧元","芬兰币|FIM|芬兰马克","法法郎|FRF|法国法郎","英镑|GBP|英镑","港币|HKD|港币","匈牙利币|HUF|匈牙利福林","印尼盾|IDR|印度尼西亚盾","印度币|INR|印度卢比","义里拉|ITL|意大利里拉","日元|JPY|日元","韩元|KER|韩元","墨披索|MXN|墨西哥比索","马币|MYR|马来西亚元","荷兰币|NLG|荷兰盾","挪威币|NOK|挪威克朗","纽币|NZD|新西兰元","菲披索|PHP|菲律宾比索","波兰币|PLN|波兰兹罗提","葡币|PTE|葡萄牙埃斯库多","卢布|RUB|俄罗斯卢布","沙乌地|SAR|沙特里亚尔","瑞典币|SEK|瑞典克朗","新加坡元|SGD|新加坡元","泰铢|THB|泰铢","台币|TWD|台币","委内拉|VEF|强势玻利瓦尔","越南盾|VND|越南盾","南非币|ZAR|南非兰特"];
    var defaultvalue = $('#currencylist').attr("title");
    for (var i=0,len = currencyArray.length;i<len;i++){
      var items = currencyArray[i].split("|");
      var opt1 = document.createElement("option");
      opt1.value = items[1];
      opt1.innerHTML = items[1]+" "+items[2];
      if (items[1] == defaultvalue) opt1.selected = "true";
      select.appendChild(opt1);
    }
  }
</script>
</html> 